<template>
    <div class="tit">
        <h3></h3>
        <p class="desc"> 
            <span>发表时间：2020-04-06 11:01:00</span>
            <span>点击次数：0</span>
        </p>
        <hr>
        <vue-preview :slides="message" class="prev"></vue-preview>
        <!-- <img class="preview-img" :src="item.src" height="100" v-for="(item,index) in message" :key="item.src" @click="$preview.open(index,message)"> -->
        <p></p>
        <conment></conment>
    </div>
    
</template>

<script>
import conment from '../subcomponents/conment.vue'
import { Toast } from 'mint-ui';
export default {
    data() {
        return {
            id:this.$route.params.id,
            message:[]
            
        }
    },
    created() {
        this.getPhotoinfo()
    },
    methods: {
        getPhotoinfo(){
            this.$http.jsonp('https://api.jisuapi.com/news/get?channel=%E5%A4%B4%E6%9D%A1&start=0&num=10&appkey=2aab973f248a3b34').then(res => {
           console.log(res.body)
                if(res.body.status == 0){
        res.body.result.list.forEach(item => {
            item.alt=item.category,
            item.title=item.src,
            item.src=item.pic
            item.msrc=item.pic
            item.w= 200,
            item.h= 200
        })
            this.message=res.body.result.list
					Toast('加载成功')
				}else{
					Toast('加载失败')
				}
         })
        }
    },
    components:{
        conment
    }
}
</script>

<style lang="scss" scoped>
    .tit{
        h3{
            text-align: center;
            color:#26a2ff;
            font-size:16px;
        }
        p{
            justify-content:space-between !important;
        }
        .my-gallery{
            figure{
                padding:10px;
                margin: 0 !important;
                    img{
                    width:100px;
                }
            }
           
        }
    }
</style>